<%@page import="com.mvc.config.ApplicationConfig"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ include file="/pages/common/taglibs.jsp"%>
<%@page import="com.mvc.framework.util.DomainUtils"%>
<%@page import="com.mvc.framework.FrameworkConstants"%>
<%@page import="com.mvc.security.model.LoginLog"%>
<%@page import="com.mvc.security.SecurityConstants"%>
<%@page import="com.mvc.framework.config.GlobalConfig"%>
<%@page import="java.util.List"%>
<%@page import="com.mvc.framework.model.Dictionary"%>

<%
	String dynamicDomain = DomainUtils.getDynamicDomain();
    request.setAttribute("dynamicDomain",dynamicDomain);
	String message = request.getParameter(FrameworkConstants.MESSAGE);
	if (message == null) {
		message = String.valueOf(request.getAttribute(FrameworkConstants.MESSAGE));
	}
	if (message == null || "null".equals(message)) {
		message = "";
	}else{
		request.setAttribute(FrameworkConstants.MESSAGE,message);
	}
	request.setAttribute("defaultTitle",ApplicationConfig.getSystemName() + "-" + ApplicationConfig.getShortName());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="zh-cn" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<title><decorator:title default="${defaultTitle}" /></title>
<decorator:head />
<script type="text/javascript">
var loginUrl = "<%=GlobalConfig.getLoginUrl()%>";
var appRoot = "<%=dynamicDomain%>";
var cookiePath = "<%=GlobalConfig.getCookiePath()%>";
var cookieDomain = "<%=GlobalConfig.getCookieDomain()%>";
var sessionName = "<%=GlobalConfig.getSessionName()%>";
var tokenName = "<%=SecurityConstants.SECURITY_TOKEN%>";
var timeoutOfLogout = "<%=ApplicationConfig.getTimeoutOfLogout()%>";
</script>
<jdf:themeFile file="mainPage.js"/>
</head>
<body scroll="yes" style="overflow-y:scroll">
	<div id="wrap">
		<div id="header">
			<div id="logo">
				<img style="vertical-align:middle;margin-left:10px;height: 76px;" src="<jdf:theme/>images/system/logo/logo_big.jpg" />
			</div>
			<ul id="header-nav">
				<li><a class="name" href="#">欢迎您，${s_fullName}</a></li>
				<li><a id="changePassword" href="${dynamicDomain}/user/changePassword">修改密码</a></li>
				<li><a href="javascript:logOut(<%=LoginLog.LOGOUT_BY_MANUAL %>)">退出</a></li>
			</ul>
		</div>
		<div id="nav">
			<div id="menu">
				<ul>
					<li <c:if test="${currentModuleId==-1}">class="current"</c:if>>
						<a href="${dynamicDomain}/index">
							首页
						</a>
					</li>
					<c:forEach varStatus="num" var="item" items="${menus}">
						<c:choose>
				  	 		<c:when test="${item.objectId==currentModuleId}">
								<li class="current">
									<a href="${dynamicDomain}/wait/${item.objectId}">${item.name}</a>
								</li>
							</c:when>
							<c:otherwise>
								<li>
									<a href="${dynamicDomain}/wait/${item.objectId}">${item.name}</a>
								</li>
							</c:otherwise>
						 </c:choose>
					</c:forEach>
				</ul>
			</div>
		</div>
		<div id="main">
			<c:choose>
				<c:when test="${currentModuleId!=-1}">
					<div id="sidebar">
						<c:choose>
							<c:when test="${not empty sideMenus}">
								<c:forEach varStatus="num" var="item" items="${sideMenus}">
									<div class="pane" <c:if test="${num.index==1 }">id="order"</c:if>>
										<div class="pane-header pane-normal-header">
											<span>${item.key.name}</span>
											<div class="pane-arrow open"></div>
										</div>
										<ul class="pane-content pane-normal-content">
											<c:forEach varStatus="num0" var="item0" items="${item.value}">
												<c:choose>
										  	 		<c:when test="${item0.objectId==currentMenuId}">
														<li class="current">
															<a href="${dynamicDomain}/wait/${item0.objectId}">${item0.name}</a>
														</li>
													</c:when>
													<c:otherwise>
														<li>
															<a href="${dynamicDomain}/wait/${item0.objectId}">${item0.name}</a>
														</li>
													</c:otherwise>
												 </c:choose>
											</c:forEach>
										</ul>
									</div>
								</c:forEach>
							</c:when>
							<c:otherwise>
							</c:otherwise>
						</c:choose>
					</div>
					<div id="separator"></div>
					<div id="content">
						<!-- Notification Area -->
	                    <div id="error"></div>
	                    <div id="success"></div>
	                    <div id="notice"></div>
						<decorator:body />
					</div>
				</c:when>
					<c:otherwise>
						<decorator:body />
					</c:otherwise>
				</c:choose>
			</div>
		<div id="footer" class="shadow-2">Copyright &copy; 2012-2015 <%=ApplicationConfig.getGroupName() %>. All Rights Reserved.</div>
	</div>
</body>
</html>